package com.itheima.test;

import com.itheima.domain.Person;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.util.Hashtable;

public class 序列化操作 {
    public static void main(String[] args) throws IOException {
        //创建对象流/序列化流
        ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream("p.ser"));

        Person p = new Person(18,"梁碧峰");

        oos.writeObject(p);

        oos.close();
    }
}
